package com.jr.controller;

import com.jr.entry.Type;
import com.jr.service.TypeService;
import com.jr.util.ResultObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;

@RestController
@RequestMapping("/type/")
public class TypeController {
    @Autowired
    private TypeService typeService;
    @Autowired
    private ResultObject resultObject;

    @RequestMapping("showType")
    public ResultObject showTypeById(Integer tid){
        resultObject.setStatus(100);
        resultObject.setResult(typeService.findTypeById(tid));
        return resultObject;
    }
}
